package com.jspeed.moderatr;

import javax.naming.Context;
import javax.naming.InitialContext;

public class ServicesModeratorLocator {

	public static ServicesModerator getServicesModerator() {
		ServicesModerator servicesModerator = null;
		try {
			final Context context = new InitialContext();
			//Object o = context.lookup("ServicesModeratorBean/remote");
			//the JNDI of the EJB 
			Object o = context.lookup("app/ServicesModeratorBean/remote");
			servicesModerator = (ServicesModerator) o;
			servicesModerator.ExecuteRequest();
		} catch (Exception ex) {
			ex.printStackTrace();
		}
		return servicesModerator;
	}
}
